<template>
	<view class="review_styles">
		
		<!-- tabs -->
		<view class="review_styles_nav">
			<uni-segmented-control :current="current" @clickItem="onClickMenus" :values="menuItems" styleType="text" activeColor="#F15F35">
			</uni-segmented-control>
		</view>
		
		<!-- 内容 -->
		<view class="review_styles_main">
			<view v-show="current === 0">
				<ReviewItem v-for="item in list" :item="item" :isShowTag="true"/>
			</view>
			<view v-show="current === 1">
				<ReviewItem v-for="item in list.filter((data) => data.tag === '未测试')" :item="item" :isShowTag="false"/>
			</view>
			<view v-show="current === 2">
				<ReviewItem v-for="item in list.filter((data) => data.tag === '已测试')" :item="item" :isShowTag="false"/>
			</view>
		</view>
		
		
	</view>
</template>

<script>
	import ReviewItem from '@/components/ReviewItem.vue'
	export default {
		components:{ReviewItem},
		data() {
			return {
				menuItems: ["全部", "未评测", "已评测"],
				current: 0,
				list: [
					{icon: "../static/logo.png", title: "测一测你的精神气质像哪个艺术家", subTitle: "家长", tag: "未测试", date: "2020-10-28"},
					{icon: "../static/logo.png", title: "测一测你的精神气质像哪个艺术家", subTitle: "家长", tag: "未测试", date: "2020-10-28"},
					{icon: "../static/logo.png", title: "测一测你的精神气质像哪个艺术家", subTitle: "家长", tag: "已测试", date: "2020-10-28"},
				]
			}
		},
		methods: {
			onClickMenus: function(item) {
				this.current = item.currentIndex
			},
		}
	}
</script>

<style>
	.review_styles {
		box-sizing: border-box;
		width: 100%;
	}
	
	.review_styles_nav {
		width: 70%;
		margin: auto;
	}

</style>
